package com.digitalchina.lxnsy.viewholder;

import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;

import com.digitalchina.lxnsy.R;
import com.digitalchina.lxnsy.entity.LandVO;
import com.digitalchina.lxnsy.interfaces.ICallBackPos;
import com.jude.easyrecyclerview.adapter.BaseViewHolder;

/**
 * ================================================
 * 项目名称：BigData
 * 类描述：
 * 包名：com.digitalchina.bigdata.viewholder
 * 创建人：白彦东
 * 创建时间：2016/12/28 18:10
 * 修改备注：
 * ================================================
 */

public class BasicInfoLandHolder extends BaseViewHolder<LandVO> {

    private TextView tvName;
    private ImageView imgEdit;
    private ICallBackPos iCallBackPos;

    public BasicInfoLandHolder(ViewGroup parent, ICallBackPos iCallBackPos) {
        super(parent, R.layout.item_basic_info_land);
        tvName = $(R.id.tv_name);
        imgEdit = $(R.id.img_edit);
        this.iCallBackPos = iCallBackPos;
    }

    @Override
    public void setData(LandVO data) {
        super.setData(data);
        tvName.setText(data.getLandParcelName());
        imgEdit.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                iCallBackPos.clickOk(getAdapterPosition());
            }
        });
    }

}
